﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Threading;

namespace CaiPiao_2ColorBall
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.ShowDialog();
            int counter = 0;
            string line;

            // Read the file and display it line by line.
            System.IO.StreamReader file = new System.IO.StreamReader(ofd.FileName);
            while (!string.IsNullOrEmpty((line = file.ReadLine())))
            {
                CaiPiaoDataItem di = new CaiPiaoDataItem(line);
                CaiPiaoIching cpi = new CaiPiaoIching(di);

                counter++;
                Console.WriteLine(counter);
                Thread.Sleep(10);
            }

            file.Close();

        }


    }
}
